package com.baoyouqun.domain.Query;

import com.baoyouqun.domain.Enum.DemandTypeEnum;
import com.baoyouqun.domain.Enum.PhonePrivacyEnum;
import com.baoyouqun.domain.Enum.ResourceUrgencyEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 后台管理-已发布帖子：条件分页查询实体
 * 整合筛选条件（关键词、分类、时间范围等）与分页参数
 */
@Data
public class AdminDemandQuery implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long size = 10L;

    private Long current = 1L;

    @ApiModelProperty(value = "关键词搜索：帖子标题/内容详情")
    private String keyWord;

    @ApiModelProperty(value = "帖子类型（页面「分类」下拉框，对应DemandTagEnum）")
    private String tag;

    @ApiModelProperty(value = "分类（提供资源/需要资源，对应DemandTypeEnum）")
    private DemandTypeEnum demandType;

    @ApiModelProperty(value = "发布人名称（模糊匹配用户表name字段）")
    private String publisherName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "发布时间范围：开始时间（格式：yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime startCreateTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "发布时间范围：结束时间（格式：yyyy-MM-dd HH:mm:ss）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endCreateTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "刷新时间范围：开始时间（刷新时更新createTime，复用该字段）")
    private LocalDateTime startRefreshTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "刷新时间范围：结束时间（格式：yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime endRefreshTime;

    @ApiModelProperty(value = "紧急程度（页面「紧急程度」下拉框，对应ResourceUrgencyEnum）")
    private ResourceUrgencyEnum resourceUrgency;

    @ApiModelProperty(value = "状态（0-隐藏，1-上架，2-删除，-1-下架）")
    private Byte status;

    @ApiModelProperty(value = "隐私保护类型（页面「隐私保护类型」下拉框，对应PhonePrivacyEnum）")
    private PhonePrivacyEnum phonePrivacy;
}